package org.papervision3d.core.animation
{
	public class BasicAnimationEngine
	{
		protected var startTime :Number;
		protected var endTime :Number;
		protected var tracks :Array;
		
		/**
		 * 
		 */ 
		public function BasicAnimationEngine()
		{
			this.tracks = new Array();
			this.startTime = this.endTime = 0;
		}
		
		/**
		 * 
		 */ 
		public function addTrack(track:AbstractTrack):AbstractTrack
		{		
			if(this.tracks.indexOf(track) == -1)
			{
				this.startTime = Math.min(this.startTime, track.startTime);
				this.endTime = Math.max(this.endTime, track.endTime);
				this.tracks.push(track);
			}
			return track;
		}
		
		/**
		 * 
		 */ 
		public function removeTrack(track:AbstractTrack):AbstractTrack
		{		
			var pos :int = this.tracks.indexOf(track);
			if(pos >= 0)
				return this.tracks.splice(pos, 1)[0] as AbstractTrack;	
			return null;
		}
		
		/**
		 * 
		 */ 
		public function play():void
		{
			if(!this.tracks || !this.tracks.length)
			{
				return;
			}
		}
		
		/**
		 * 
		 */ 
		public function stop():void
		{
		}
	}
}